package com.CloudDream.config;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import java.io.File;
import java.io.IOException;

public class Config {
    public static File playerdata = new File("plugins/MoonCake/PlayerData.yml");
    public static FileConfiguration pd;

    public static void loadData() {
        pd = YamlConfiguration.loadConfiguration(playerdata);
        pd.options().copyDefaults(true);
    }

    public static void savepd() {
        try {
            pd.save(playerdata);
        } catch (IOException e) {
            Bukkit.getConsoleSender().sendMessage("&c加载PlayerData.yml出现了错误");
        }
    }
}
